package org.example.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OrderServiceImpl implements OrderService {
    private final OrderProcessor orderProcessor;
    private final PaymentService paymentService;

    public OrderServiceImpl(OrderProcessor orderProcessor, PaymentService paymentService) {
        this.orderProcessor = orderProcessor;
        this.paymentService = paymentService;
    }

    @Override
    public void processOrder(String orderId) {
        System.out.println("Processing order: " + orderId);
        orderProcessor.process(orderId);
        paymentService.pay(orderId);
        paymentService.additionalPaymentProcessing(orderId);
    }
}